package it.uniroma2.art.coda.structures;

import it.uniroma2.art.coda.pearl.model.GraphStruct;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * This class contains all the suggestion produced by a Triples Smart Suggestion Component
 * 
 * @author Andrea Turbati
 */

public class TriplesSmartSuggestionStruct extends InterComponentObject {
	
	Map<GraphStruct, List<ARTTriple>> graphStructToARTTriplesMap;
	
	public TriplesSmartSuggestionStruct(){
		graphStructToARTTriplesMap = new HashMap<GraphStruct, List<ARTTriple>>();
	}
	
	/**
	 * Add a ARTTriple to a particular GraphStruct
	 * @param artTriple the ARTTriple to add
	 * @param graphStruct the GraphStruct to which the ARTTriple is added to
	 */
	public void addARTTripleToGraphStruc(ARTTriple artTriple, GraphStruct graphStruct){
		if(!graphStructToARTTriplesMap.containsKey(graphStruct)){
			graphStructToARTTriplesMap.put(graphStruct, new ArrayList<ARTTriple>());
		}
		graphStructToARTTriplesMap.get(graphStruct).add(artTriple);
	}
	
	
	
	/**
	 * Get the List of ARTTriple from a given GraphStruct
	 * @param graphStruct the GraphStruct to which the ARTTriples List is associated to 
	 * @return the List of ARTTriples from the given GraphStruct
	 */
	public List<ARTTriple> getARTTriplesListFromGraphStruct(GraphStruct graphStruct){
		return graphStructToARTTriplesMap.get(graphStruct);
	}
	
	/**
	 * Get the map containing the GraphStruct to ARTTriples List
	 * @return the map containing the GraphStruct and the list of ARTTriples
	 */
	public Map<GraphStruct, List<ARTTriple>> getGraphStructToARTTriplesMap(){
		return graphStructToARTTriplesMap;
	}

}
